-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add NURBS #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NURBS #24
Conversation
What is NURBS? Can you link a paper? Maybe in a docstring as well? |
src/interpolation_utils.jl
Outdated
@@ -56,6 +80,13 @@ function get_output_size(interp::NDInterpolation{N_in}) where {N_in} | |||
size(interp.u)[(N_in + 1):end] | |||
end | |||
|
|||
make_zero(::T) where {T <: Number} = zero(T) | |||
|
|||
function make_zero(v::T) where {T <: AbstractArray} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function make_zero(v::T) where {T <: AbstractArray} | |
function make_zero!!(v::T) where {T <: AbstractArray} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean? That some methods are mutating and some aren't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NURBS stands for Non-Uniform Rational Basis Spline. It's a generalization of B-Spline geometries, where a weight is associated with each control point which determines how relatively attractive the control point is. When all weights are the same, the geometry reduces to a B-spline. NURBS are apparently popular in CAD. The weights are used to construct piecewise rational weight functions for the control points, hence the R (which also makes analytical derivatives a pain). Using the weights certain shapes can be represented exactly which can only be approximated by B-Splines, for instance a circle (which is why I use that in a unit test). The Wikipedia page does a pretty good job of introducing the concept, but the go-to source for this subject is The NURBS book. |
https://www.brnt.eu/phd/node11.html clears it up. I think this looks good sans the small comments I had above. |
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Fixes #16